<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>box model</title>
    <style>
        #box {
            background-color: gray;
            width: 300px;
            height: 300px;
            /*padding: 10px;  !*四个方向，内边距全为10px*!*/
            /*padding: 10px 20px;  !*上下内边距为10px，左右为20px*!*/
            /*padding: 10px 20px 30px 40px;  !*方向为上右下左*!*/
            padding-top: 10px;  /*上内边距*/
            padding-right: 20px;  /*右内边距*/
            padding-bottom: 30px;  /*下内边距*/
            padding-left: 40px;  /*左内边距*/
            border-top: 5px solid darkgreen;
            border-right: 5px dotted darkorange;
            border-bottom: 5px dashed purple;
            /*margin: 50px;*/
            margin: 10px auto;   /*左右外边距设置为自动，则该元素居中显示*/
        }
        #box2 {
            width: 500px;
            height: 400px;
            margin: 0 auto;
            padding: 20px;
            background-image: url("http://pic.people.com.cn/NMediaFile/2020/0727/MAIN202007270830000353599166021.JPG");
        }
        .c1 {
            width: 500px;
            height: 360px;
            background-color: #ffffff;
            opacity: 0.6;  /*透明度，0到1之间的数字*/
        }
    </style>
</head>
<body>
<div id="box">
    hello world
</div>
<div id="box2">
    <div class="c1">
        afsdfdsa lkjfasdlkjfdsa ljfs dalkj
    </div>
</div>
</body>
</html>